<?php
namespace BP\DA;
require_once("java/math/BigDecimal.php");
require_once("java/sql/Timestamp.php");
require_once("java/sql/Types.php");
require_once("java/util/Date.php");
class Para {
	public $ParaName;	// String
	public $Size;	// int
	public $val;	// Object
	public $DAType;	// Object
	private function __init() { // default class members
		$this->ParaName = NULL;
		$this->Size = 10;
	}
	public static function getDAType_Object ($val) // [Object val]
	{
		if ($val instanceof Integer)
		{
			return Integer;
		}
		else
			if ($val instanceof String)
			{
				return String;
			}
			else
				if ($val instanceof Double)
				{
					return Double;
				}
				else
					if ($val instanceof Float)
					{
						return Float;
					}
					else
						if ($val instanceof Long)
						{
							return Long;
						}
						else
							if ($val instanceof BigDecimal)
							{
								return BigDecimal;
							}
							else
								if ($val instanceof Boolean)
								{
									return Boolean;
								}
								else
									if ($val instanceof Date)
									{
										return Date;
									}
									else
										if ($val instanceof Timestamp)
										{
											return Timestamp;
										}
										else
										{
											return NULL;
										}
	}
	public static function getDAType_Integer ($type) // [Integer type]
	{
		$obj = NULL;
		switch ($type) {
			case $Types->CHAR:
				$obj = String;
				break;
			case $Types->VARCHAR:
				$obj = String;
				break;
			case $Types->LONGVARCHAR:
				$obj = String;
				break;
			case $Types->INTEGER:
				$obj = Integer;
				break;
			case $Types->FLOAT:
				$obj = Double;
				break;
			case $Types->DOUBLE:
				$obj = Double;
				break;
			case $Types->REAL:
				$obj = Float;
				break;
			case $Types->BIGINT:
				$obj = Long;
				break;
			case $Types->NUMERIC:
				$obj = BigDecimal;
				break;
			case $Types->DECIMAL:
				$obj = BigDecimal;
				break;
			case $Types->DATE:
				$obj = Date;
				break;
			case $Types->TIMESTAMP:
				$obj = Date;
				break;
			case $Types->BIT:
				$obj = Boolean;
				break;
			case $Types->CLOB:
				$obj = String;
				break;
			default:
				$obj = Object;
		}
		return $obj;
	}
	public static function constructor__ () 
	{
		$me = new self();
		$me->__init();
		return $me;
	}
	public static function constructor__String_Object_Object ($_paraName, $_DAType, $_val) // [String _paraName, Object _DAType, Object _val]
	{
		$me = new self();
		$me->__init();
		$me->ParaName = $_paraName;
		$me->DAType = $_DAType;
		$me->val = $_val;
		return $me;
	}
}
?>
